import Vue from "vue";
import VueRouter from "vue-router";

// 引入组件
import home from '@/views/home.vue'
import alarm from '@/views/alarm.vue'
import realtimemonitor from '@/views/realtimemonitor.vue'
import my from '@/views/my.vue'
import login from '@/views/login.vue'

// 要告诉 vue 使用 vueRouter
Vue.use(VueRouter);

const routes = [
    {
        path: "/home",
        component: home,
        name:'home'
    },
    {
        path: "/alarm",
        component: alarm,
        name:'alarm'
    },
    {
        path: "/realtimemonitor",
        component: realtimemonitor,
        name:'realtimemonitor'
    },
    {
        path: "/my",
        component: my,
        name:'my'
    },
    {
        path:'/',
        component:login
    }
]

let router = new VueRouter({
    routes
})
export default router;